package cn.ciis.basic.event;

import cn.ciis.basic.websocket.AuthorityWebSocket;
import com.jfinal.aop.Aop;
import com.jfinal.kit.LogKit;
import net.dreamlu.event.core.EventListener;

public class OnStartEventListen {

    AuthorityWebSocket authorityWebSocket = Aop.get(AuthorityWebSocket.class);

    @EventListener(async = true)
    public void  OnStartEventListen(OnStartEvent event)  {
        for (int i = 0; i < 10000; i++) {
            authorityWebSocket.sendAll(null);
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                LogKit.error("给浏览器发送socket信息失败");
            }
        }
    }

}
